<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>优惠券页面</title>
<link href="${root}/u/css/main.css" type="text/css" rel="stylesheet" />
<script src="${root}/u/js/jspgou/jquery1.42.min.js" type="text/javascript"></script>
<script src="${root}/u/js/jspgou/jquery.superslide.2.1.1.js" type="text/javascript"></script>
<script src="${root}/u/js/jspgou/leftlanmu.js" type="text/javascript"></script>
<script src="${root}/u/js/jspgou/1/lib.js" type="text/javascript"></script>
<script language="JavaScript" type="text/JavaScript">
function addToCoupon(id){
	$.post('getcoupon.jspx',{
		'id' : id   
	},function(data){
		if(data.status==1) {
			alert("领取成功!");
		} else if(data.status==2) {
			 alert(data.error);
		} else {
			location.href='${loginUrl}';
		}
		},'json');
}

</script>
<style type="text/css">
.coupon_list {
	border:1px solid #eaeaea;
    padding:20px 0px 20px 0px;
}
ul, li {
    list-style-type: none;
    overflow:hidden;
}
.coupon_img {
    float:left;
    width:460px;
    height:113px;
	background:url(${root}/u/img/youhui.gif);
}
.coupon_info {
	padding:20px 50px 13px 10px;
	float:left;
}
.coupon_info p {
    color:#fff;
    line-height:24px;
}
.coupon_exchange {
    width: 130px;
    float: right;
    text-align: center;
    line-height: 1;
}
.coupon_exchange p {
    font-family: "微软雅黑";
    font-size: 14px;
    color: #6B6A6A;
    line-height: 1.8;
}
.book, .nostart_btn {
    display: inline-block;
    width: 93px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    color: #FFF;
    font-family: "微软雅黑";
    font-size: 18px;
}
.all-goods .posone{ left:236px;}
</style>
</head>
<body>
<body style="background:url(${root}/u/img/jspgou/bg2.gif) repeat-x;">
<div class="w1187b">
	<div class="lm_w239">
        [#include "../include/all_goods_classification.html"/]
    </div>
	<div class="lm_w948">
    	[#include "../include/title_top.html"/]
    	[#include "../include/title_nav.html"/]
        <div class="w935b">
        	<!--页头搜索栏开始-->
            <form id="searchForm" action="${base}/search.jspx">
                <input name="q" id="q" value="${q!'请输入关键词'}" type="text" 
                       onfocus="if(this.value=='请输入关键词')this.value=''" 
                       onblur="if(this.value=='')this.value='请输入关键词'" class="key_search" />
                <input type="submit" value="" class="menu_search" />
            </form>
            <div class="hotwords">
                <span>热门：</span>
                [@keyword_list count= 6]
                [#if tag_list?size gt 0]
                [#list tag_list as kw]
                <a id="${kw.keyword}" onclick="parssKey(this);" style="cursor:pointer">${kw.keyword}</a> 
                [/#list]
                [#else]
                [/#if]
                [/@keyword_list]
            </div>
			<script type="text/javascript">
				function parssKey(o){
					var v=o.id;
					$("#q").val(v);
					document.getElementById("searchForm").submit();
				} 
			</script>
			<!--页头搜索栏结束-->	            
			<div class="clear10"></div>
    	</div>
        <img src="${root}/u/img/jspgou/line_r2.gif" width="10" height="" class="w10" />
    </div>
	<div class="clear20"></div>
    
    <div class="w1168" style="line-height:41px;">您现在的位置：店中店优惠券</div>
    <div>
<form id="tableForm">
[#if pagination.list?size gt 0]	
        <ul class="coupon_list"> 
        [#list pagination.list as coupon]
        <li style="border-bottom:1px solid #eaeaea; padding-bottom:20px; margin-bottom:20px; font-family:Arial,宋体; float:left; margin-left:60px;">
            <div class="coupon_img">
            	<div class="fl" style="margin:20px 20px 13px 20px;">
                	<img src="${base!}${coupon.couponPicture!}" width="75" height="75" />
                </div>
                <div class="coupon_info">
                <p>优惠劵名称：${coupon.couponName!}</p>
                <p>使用条件：减￥<span style=" font-size:24px; font-weight:bold;">${coupon.couponPrice!}.00</span>满${coupon.leastPrice!}.00可用</p>
                <p>有效时间：${coupon.couponTime?string('yyyy-MM-dd')} - ${coupon.couponEndTime?string('yyyy-MM-dd')}</p>
                </div>
            </div>
            <a href="javascript:void(0);" onclick="javascript:addToCoupon(${coupon.id!});" class="fl"><img src="${root}/u/img/lingqu.gif" width="37" height=""></a>
        </li>   
        [/#list]   
        </ul>
    </div>
	<div class="clear20"></div>
	<input type="hidden" name="pageNo"/>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td align="center" class="pn-sp">
	共 ${pagination.totalCount} 条&nbsp;
	每页 ${pagination.pageSize} 条&nbsp;
	<input type="button" value="首 页" onclick="_gotoPage('1');"[#if pagination.firstPage] disabled="disabled"[/#if]/>
	<input type="button" value="上一页" onclick="_gotoPage('${pagination.prePage}');"[#if pagination.firstPage] disabled="disabled"[/#if]/>
	<input type="button" value="下一页" onclick="_gotoPage('${pagination.nextPage}');"[#if pagination.lastPage] disabled="disabled"[/#if]/>
	<input type="button" value="尾 页" onclick="_gotoPage('${pagination.totalPage}');"[#if pagination.lastPage] disabled="disabled"[/#if]/>&nbsp;
	当前 ${pagination.pageNo}/${pagination.totalPage} 页 &nbsp;转到第<input type="text" id="_goPs" style="width:50px" onfocus="this.select();" onkeypress="if(event.keyCode==13){$('#_goPage').click();return false;}"/>页
	<input id="_goPage" type="button" value="转" onclick="_gotoPage($('#_goPs').val());"[#if pagination.totalPage==1] disabled="disabled"[/#if]/>
</td>
</tr>
</table>
<script type="text/javascript">
function _gotoPage(pageNo) {
	try{
		var tableForm = document.getElementById("tableForm");
		$("input[name=pageNo]").val(pageNo);
		tableForm.action="coupon.jspx";
		tableForm.onsubmit=null;
		tableForm.submit();
	} catch(e) {
		alert('_gotoPage(pageNo)方法出错');
	}
}
</script>
[#else]
	<div>暂无优惠劵</div>
[/#if]
</form>
</div>
<div class="clear20"></div>
[#include "../include/footer_information_bar.html"/]
</body>
</html>